Next | Prev | Up | Top | Contents | Index

Relationship to Other Device Special Files

The files in /dev/scsi describe many of the same devices that are described by files in /dev/dsk, /dev/tape, and other directories. There is a security exposure in that a user-level program could use a /dev/scsi file to do almost anything to a disk or tape, including total erasure.

The dsreq device driver forces exclusivity with itself; that is, a given /dev/scsi file can be opened only by one process at a time. However, a device could be open through the dsreq driver at the same time it is open by another process, or by a filesystem, through a different device special file and device driver. For example, a disk volume could be simultaneously open through the name /dev/scsi/sc0d0l0 and through /dev/rdsk/dks0d1s0.

The process that opens a generic SCSI device can request exclusivity using the O_EXCL option to open(). In that case, the open is rejected when the device is already open through another driver; and no other driver can open the device until the generic device file is closed.


Next | Prev | Up | Top | Contents | Index